package me.zhengjie.modules.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.modules.biz.domain.Vip;
import me.zhengjie.modules.biz.mapper.VipMapper;
import me.zhengjie.modules.biz.service.TextService;
import org.springframework.stereotype.Service;

import static me.zhengjie.modules.biz.constant.GlobalConstant.*;

@Service
@Slf4j
@RequiredArgsConstructor
public class TextServiceImpl implements TextService {

    private final VipMapper vipMapper;

    @Override
    public String remind(Integer category) {
        Vip vip;
        switch (category){
            case 1: // 高考提示
                return REMIND;
            case 2: // 统招，单招智能荐校文案
                return TZ_DZ_RECOMMEND;
            case 3: // 专升本智能荐校文案
                return ZSB_RECOMMEND;
            case 4: // 统招vip提示文案
                vip = vipMapper.selectOne(new QueryWrapper<Vip>().eq("vip_code", TZ_VIP_CODE));
                return vip.getRemark();
            case 5: // 专升本vip提示文案
                vip = vipMapper.selectOne(new QueryWrapper<Vip>().eq("vip_code", ZSB_VIP_CODE));
                return vip.getRemark();
            case 6: // 单招vip提示文案
                vip = vipMapper.selectOne(new QueryWrapper<Vip>().eq("vip_code", DZ_VIP_CODE));
                return vip.getRemark();
            default:
                log.info("类型错误");
        }
        return null;
    }
}
